<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>知识库</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__common.css" />


    <style>
        body {
            background-color: #F5F5F5;
        }
        .right{
            width: 10.3rem;
        }
        .warrp{
            width: 100%;
            padding: 0.8rem 1.3rem 0 0.8rem;
            background-color: #fff;
        }
        .cooc{
            width: 100%;
            height: 6rem;
            display: flex;
        }
        .header {
            width: 5rem;
            height: 5rem;
        }
        .title{
            font-size:0.75rem;
            color:#333333;
            line-height:0.85rem;
            font-weight: bold;
        }
        .cont{
            font-size:0.7rem;
            color:#666666;
            line-height:1.4rem;
        }
        .timefrom{
            margin-top: 2.35rem;
            display: flex;
            justify-content: space-between;
            font-size:0.6rem;
            color:rgba(153,153,153,1);
            line-height:0.6rem;
        }
    </style>
    <style>
        .box {
            background: #F7B100;
            height: 3.65rem;
            color: #1A1A1A;
            font-size: 0.85rem;
            text-align: center;
            padding-top: 28px;
            position: relative;
        }

        .choose {
            color: #fff!important;
            border-bottom: 1px solid rgba(0, 0, 0, 0) !important;
            font-weight: bold;
            border-bottom: 1px solid #FFFFFF;
            display: inline-block;
        }

        .choose:after {
            content: '';
            display: block;
            height: 0;
            width: 1rem;
            border-radius: 2px;
            border-top: 2px solid #fff;
            position: absolute;
            bottom: -0.15rem;
            left: 50%;
            -webkit-transform: translateX(-50%);
        }
        /*tab切换*/

        .tab-grid {
            width: 100%;
            height: 2.25rem;
            overflow-x: scroll;
            overflow-y: hidden;
            background-color: white;
            position: relative;
            padding-left: 0.75rem
        }
        /*控制滚动条*/

        .tab-grid::-webkit-scrollbar {
            height: 0;
        }

        .tab-row {
            width: 112%;
            height: 2rem;
            margin-left: 0.8rem;
            margin-right: 0.8rem;
            background-color: #fff;
        }

        .tab-item {
            float: left;
            height: 2.25rem;
            padding-left: 0.375rem;
            padding-right: 1rem;
            line-height: 2.25rem;
            text-align: center;
            font-size: 0.75rem;
            color: #333;
            font-weight: bold;
        }

        .list {
            height: 2rem;
        }

        .display-right-20 {
            position: relative;
            margin-right: 2.375rem;
        }

        .box>.display-right-20:last-child {
            margin-right: 0;
        }

        .choose1 {
            color: #F7B100;
            font-size: 0.75rem;
        }

        .tab-item-all {
            width: 10000%;
            padding-left: 0.15rem;
        }

        .item_active {
            font-weight: bold;
            color: #E73C5C;
            font-size: 0.75rem;
            background-size: 100% 2px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(to right, transparent 16%, #E73C5C 16%, #E73C5C 65%, transparent 65%, transparent 100%);
            background-image: -webkit-linear-gradient(to right, transparent 16%, #E73C5C 16%, #E73C5C 65%, transparent 65%, transparent 100%);
        }

        .tab-grid-right {
            width: 1.5rem;
            height: 2.4rem;
            position: fixed;
            right: 0;
            top: 25px;
            background-size: 30px 16px;
            background-repeat: no-repeat;
            background-position: right;
            background-image: linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, white 55%, white 100%);
            background-image: -webkit-linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, white 55%, white 100%);
        }
        .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.7rem;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }
        .aui-icon-tu{
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 19px 19px;
        }

        .aui-bar-nav .aui-iconfont1{
            position: relative;
            z-index: 20;
            font-size: 0.9rem;
            color: #ffffff;
            line-height: 2.4rem;
            padding-left: 0.75rem;
        }

        .aui-searchbar {
            display: -webkit-box;
            -webkit-box-pack: center;
            -webkit-box-align: center;
            height: 2.4rem;
            overflow: hidden;
            width: 100%;
            background-color: #ffffff;
            color: #9e9e9e;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        .aui-searchbar-input {
            margin-right: 0.75rem;
            margin-left: 0.75rem;
            background-color: #F5F7F8;
            border-radius: 1rem;
            height:1.6rem;
            line-height: 30px;
            font-size: 0.7rem;
            position: relative;
            /*padding-left: 0.0rem;*/
            display: -webkit-box;
            -webkit-box-flex: 1;
            /*padding-right:1.0rem;*/
        }

        .aui-searchbar-input input {
            color: #999999;
            width: 100%;
            padding: 0;
            margin: 0;
            height: 1.5rem;
            line-height: normal;
            border: 0;
            -webkit-appearance: none;
            font-size: 0.7rem;
            background-color: #ffffff;
        }

        .aui-searchbar .aui-iconfont {
            line-height: 1.50rem;
            color: #9e9e9e !important;
        }

        .aaa {
            height: 1.5rem;
            line-height: 1.5rem;
            font-size: 0.65rem;
            color:rgba(204,204,204,1) !important;
            display: inline-block;
            vertical-align: top;
            margin-top: 0px;
        }

        .aui-icon-search:before {
            content: '';
            width: 15px;
            height: 1.50rem;
            background: url('__IMG__main1Search.png') no-repeat center center;
            background-size: 15px 15px;
            display: inline-block;
        }


        .aui-bar-nav .aui-title {
            min-height: 2.4rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            right: 0.75rem;
            left: 1.5rem;
            /* width: auto; */
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
        }
        .pposition{
            min-height: 2.4rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            /*right: 0.75rem;*/
            left: 0rem;
            width: 12rem;
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
        }
        .pposition_left{
            float: left;
            width: 0.75rem;
            height: 0.7rem;
            margin-top: 0.85rem;
        }
        .eara{
            float: left;
            color: #4F3E37;
            font-size: 14px;
            margin: 0 0.2rem;
        }
        .pposition_right{
            float: left;
            width: 0.75rem;
            height: 0.7rem;
            margin-top: 0.85rem;
        }
        .aui-icon-rightu{
            height: 2.4rem;
            width: 49px;
            margin-top:0.1rem;
            margin-right:0.2rem;
        }
    </style>
</head>
<body>
<header class="aui-bar aui-bar-nav underLine" style="padding-top:1.25rem;background-color:#FFFFFF;" id="header">
    <div class="aui-searchbar underLine" id="search"  onclick="left()">
        <div class="aui-searchbar-input aui-border-radius" >
            <div style="">
                <span class="aui-iconfont aui-icon-search"></span>
                <span class="aaa">输入关键字</span>
            </div>
        </div>
    </div>
</header>
<section class="tab-grid underLine" id='tab'>
    <!-- <div class="tab-grid-right"></div> -->
    <div class="tab-item-all" id="list">
        {volist name="cate" id="vo"}
        <div class="tab-item {if $vo['information_type_id']==$cate_id} item_active {/if}" tapmode onclick="openFrame(this)" idd="{$vo.information_type_id}">{$vo.information_type_name}</div>
        {/volist}
    </div>
</section>
<div class="warrp"  style="margin-bottom: 0.2rem;">
    <div class="upOrDown">
        <div class="upOrDown_data">
            {volist name="list" id="vv"}
            <div class="cooc underLine" onclick="detail(this)" idd="{$vv.information_id}">
                <div class="header">
                    <img src="{$vv.information_img}" alt="">
                </div>
                <div class="right" style="margin-left:0.8rem">
                    <div class="title aui-ellipsis-1" >
                        {$vv.information_title}
                    </div>
                    <div class="cont aui-ellipsis-1" style="">
                       {$vv.information_introduce}
                    </div>
                    <div class="timefrom">
                        <div class="from">
                            {$vv.mechanism_for}
                        </div>
                        <div class="time">
                            {$vv.information_release_time}
                        </div>
                    </div>
                </div>
            </div>
            {/volist}
        </div>
    </div>
</div>
<input type="hidden" name="cate_id" value="{$cate_id}">
<div class="underNav">
    <div class="kuai" onclick="opennew(1);">
        <img src="__IMG__nav/nav11.png" alt="">
        <div class="Navfont">首页</div>
    </div>
    <div class="kuai" onclick="opennew(2);">
        <img src="__IMG__nav/nav22.png" alt="">
        <div class="Navfont">机构</div>
    </div>
    <div class="kuai" onclick="opennew(3);">
        <img src="__IMG__nav/nav33.png" alt="">
        <div class="Navfont">公益课堂</div>
    </div>
    <div class="kuai" onclick="opennew(4);">
        <img src="__IMG__nav/nav4.png" alt="">
        <div class="Navfont1">知识库</div>
    </div>
    <div class="kuai" onclick="opennew(5);">
        <img src="__IMG__nav/nav55.png" alt="" >
        <div class="Navfont">我的</div>
    </div>
</div>
</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__layer_mobile/layer.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__common.js"></script>

<script>
    // 导航栏跳转
    function opennew(index) {
        if (index==1){
            location.href='{:url("First/index")}';
        } else if (index==2){
            location.href='{:url("Mechanism/index")}';
        } else if (index==3){
            location.href='{:url("Classroom/index")}';
        }else if (index==4){
            location.href='{:url("Information/index")}';
        }else if (index==5){
            location.href='{:url("My/index")}';
        }

    }
    function left() {
        location.href='{:url("Information/search")}';
    }
    //详情
    function detail(el) {
        var idd=$api.attr(el,'idd');
        location.href = '{:url("Information/detail")}?id='+idd;

    }
</script>
<script>
    //table切换
function openFrame(el) {
    var idd=$api.attr(el,'idd');
    location.href = '{:url("Information/index")}?cate_id='+idd;
}
</script>
<script>
    var page = 1;
    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea : window,
        autoLoad : true,
//        domUp : {
//            domClass   : 'dropload-up',
//            domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
//            domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
//        },
//        domDown : {
//            domClass   : 'dropload-down',
//            domRefresh : '<div class="dropload-refresh">刷新</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//            domNoData  : '<div class="dropload-noData">无数据</div>'
//        },
        loadDownFn : function(me){
            var keyword = $('input[name="cate_id"]').val();

            page++;
            $.ajax({
                url:'{:url("Information/ajaxInformation")}',
                data:'page='+page+'&cate_id='+keyword,//
                type:'POST',
                dataType:'JSON',
                success: function(data){
                    var arrLen = data.msg.length;
                    if(arrLen<=0){
                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }else{
                        var datas = data.msg;
                        $.each(datas,function(key,v){
                            var _html='';

                          _html +='<div class="cooc underLine" onclick="detail(this)" idd="'+v.information_id+'">';
                          _html +='<div class="header">';
                          _html +='<img src="'+v.information_img+'" alt=""></div>';
                          _html +='<div class="right" style="margin-left:0.8rem">';
                          _html +='<div class="title aui-ellipsis-1" >'+v.information_title+' </div>';
                          _html +='<div class="cont aui-ellipsis-1" style="">'+v.information_introduce+'</div>';
                          _html +='<div class="timefrom">';
                          _html +='<div class="from">'+v.mechanism_for+'</div>';
                          _html +='<div class="time">'+v.information_release_time+'</div> </div> </div></div>';
                          $(".upOrDown_data").append(_html);
                        });
//                        $('.upOrDown_data').append(data);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }


                },
                error: function(xhr, type){
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn : function(me){
            var keyword = $('input[name="cate_id"]').val();

            page = 1;
            $.ajax({
                url:'{:url("Information/ajaxInformation")}',
                data:'page='+page+'&cate_id='+keyword,
                type:'POST',
                dataType:'json',
                success: function(data){
                    $('.upOrDown_data').empty();//
                    var datas = data.msg;
                    $.each(datas,function(key,v){
                        var _html='';
                        _html +='<div class="cooc underLine" onclick="detail(this)" idd="'+v.information_id+'">';
                        _html +='<div class="header">';
                        _html +='<img src="'+v.information_img+'" alt=""></div>';
                        _html +='<div class="right" style="margin-left:0.8rem">';
                        _html +='<div class="title aui-ellipsis-1" >'+v.information_title+' </div>';
                        _html +='<div class="cont aui-ellipsis-1" style="">'+v.information_introduce+'</div>';
                        _html +='<div class="timefrom">';
                        _html +='<div class="from">'+v.mechanism_for+'</div>';
                        _html +='<div class="time">'+v.information_release_time+'</div> </div> </div></div>';
                        $(".upOrDown_data").append(_html);
                    });
                    me.resetload();
                    me.unlock();
                    me.noData(false);
//                    $('.cooc').click(function () {
//                        var id = $(this).attr('id');
//                        location.href = '{:url("Mechanism/mechanismDetail")}?id='+id;
//                    });
                },
                error: function(xhr, type){
                    alert('Ajax error!');
                    me.resetload();
                }
            });
        }
    });
</script>
</html>
